--[[/**
-- * 
 雷克斯被动效果
-- *
-- */]]

---@class BuffEffect75101 : BaseBuffEffect
BuffEffect75101 = ClientFight.CreateClass("BuffEffect75101", ClientFight.BaseBuffEffect)
local t = BuffEffect75101

function t:afterAdd( fight, buff)
if (buff.overlay < buff.buffBean.f_MaxReplaceLyer)then
return;
end
 local buffEffectValue = buff.buffBean.f_BuffEffectValue;
 local addBuffId = buffEffectValue[1];
BuffManager.addBuff(fight, buff.skill, buff.source, buff.target, false, addBuffId, 1);
--移除自身
BuffManager.removeFighterBuff(fight,buff.target,buff,true);
end


--[[ /**
--     * 触发时机,被伤害前 (因为这个buff是加到了敌人身上的,所以是在被伤害前, 做一次伤害加深)
--     * 效果:伤害加成
--     * @param fight
--     * @param buff
--     * @param parameters
--     * @return
--     */]]
---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
   local  parameters = {...};
 local result = parameters[3];
 if (not result:isDamage()) then
 return IBuffEffect.FAIL;
 end

 local ratio = buff.buffBean.f_BuffEffectValue[1] *  buff.overlay;
 local damage = calcRatio(result.damage, ratio);
 result.setDamage(result.damage + damage);

 SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff" .. buff.modelId .. " 总伤害：" .. result.damage.." 额外附加: "..damage .." 伤害加成系数: "..ratio.." %%");

 return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()